#include <iostream>
#include <iterator>
#include <cstddef>

namespace util {
    template<typename Iterable>
    struct enumerate {
        Iterable iter;
        size_t size;
        decltype(std::begin(iter)) begin_;
        const decltype(std::end(iter)) end_;

        constexpr enumerate(Iterable iter): iter(iter), size(0),
                                            begin_(std::begin(iter)), end_(std::end(iter)) {}

        constexpr const enumerate& begin() const { return *this; }
        constexpr const enumerate& end()   const { return *this; }

        constexpr bool operator!=(const enumerate&) const { return begin_ != end_; }

        constexpr void operator++() { ++begin_; ++size; }

        constexpr std::pair<size_t, decltype(*begin_) &> operator*() const {
            return { size, *begin_ };
        }
    };

    namespace literals {
        inline std::ostream & operator<<(std::ostream &os, std::byte b) {
            return os << std::to_integer<int>(b);
        }

        inline constexpr std::byte operator ""_b(unsigned long long b) noexcept
        {
            return static_cast<std::byte>(b);
        }
    }
}
